﻿using Newtonsoft.Json;
using T.FAS.Runtime.Base.Entity;
using T.FAS.Runtime.Expression.Entity;
using T.FAS.Runtime.Expression.Service;
using T.FAS.Runtime.MF.Dao;
//using T.FAS.Runtime.Expression.Service;

namespace T.FAS.Runtime.MF.Activities
{
    public class FasExpSdkService : IFasExpService
    {
        public ExprResult DQExecute(string jsString, Dictionary<string, object> inputParam)
        {
             return ExprService.GetInstance.DQExecute(jsString, inputParam);
        }

        public ExprResult Execute(string jsString, FASContext fASContext, Dictionary<string, object> inputParam)
        {
            return ExprService.GetInstance.Execute(jsString, fASContext, inputParam);
        }

        public ExprResult JSExecute(string jsString, Dictionary<string, object> inputParam)
        {
             return ExprService.GetInstance.JSExecute(jsString, inputParam);
        }

        public ExprResult Debug(string jsString, Dictionary<string, object> inputParam, Dictionary<string, string> extraParams=null)
        {
             var result= ExprService.GetInstance.JSExecute(jsString, inputParam);
            LogUtil.Log($"result={JsonConvert.SerializeObject(result)}");
            LogUtil.Log($"result={result.GetType()}");
            return result;
        }

        public ExprResult JSExecuteNotReport(string jsString, Dictionary<string, object> inputParam)
        {
            return ExprService.GetInstance.JSExecuteNotReport(jsString, inputParam);
        }
    }
}
